package com.realgodo.site.web;

import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
import org.springframework.context.annotation.Scope;
import org.springside.modules.web.struts2.Struts2Utils;

import com.realgodo.site.common.Constant;

@Scope("prototype")
@Results( { @Result(name = "index_page", type = "redirect", location = "${base}/") })
public class LogoutController extends ControllerSupport {

	private static final long serialVersionUID = 819542939230520466L;

	public String index() {
		Struts2Utils.getSession().removeAttribute(Constant.LOGIN_USER_ID);
		Struts2Utils.getSession().removeAttribute(Constant.LOGIN_SPACE);

		return "index_page";
	}

}
